package com.ww.springboot.boot.algorithm.leetcode1;

/**
 * 描述：
 *
 * @author 🧑 ‍wanwei
 * @since 2023-07-08 15:37
 */
public class DD167 {

    public static void main(String[] args) {

        int[] numbers = {2,3,4};
        int target = 6;
        PrintUtil.print(twoSum(numbers, target));

    }

    public static int[] twoSum(int[] numbers, int target) {
        for (int i = 0; i < numbers.length; i++) {
            for (int j = i + 1; j < numbers.length; j++) {
                if(numbers[i] + numbers[j] == target){
                    return new int[]{i+1, j+1};
                }
            }
        }
        return null;
    }
}
